package com.qdlc.p2p.biz.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.service.ScoreTypeService;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dao.ScoreTypeDao;
import com.qdlc.p2p.dal.dto.ScoreType;
import com.qdlc.p2p.dal.model.ScoreTypeModel;

@Service("scoreTypeService")
public class ScoreTypeServiceImpl implements ScoreTypeService {

	@Resource
	private ScoreTypeDao scoreTypeDao;

	@Override
	public PageDataList<ScoreTypeModel> scoreRuleList(ScoreTypeModel model) {
		return scoreTypeDao.scoreRuleList(model);
	}

	@Override
	public ScoreType update(ScoreTypeModel model) {
		ScoreType scoreType = ScoreTypeModel.prototype(model);
		return scoreTypeDao.update(scoreType);
	}

	@Override
	public ScoreType findById(long id) {
		return scoreTypeDao.find(id);
	}

	/**
	 * 开启禁用规则
	 * @param model
	 * @return
	 */
	@Override
	public int toggleStatus(ScoreTypeModel model) {
		return scoreTypeDao.toggleStatus(model);
	}

}
